package xian_cheng;

/***
 *@title RunnableTest
 *@description <TODO description class purpose>
 *@author 许文迪
 *@version 1.0.0
 *@create 2025/5/27 14:40
 **/
public class RunnableTest implements Runnable{
    @Override
    public void run() {
        System.out.println("RunnableTest线程启动了");
        try {
            System.out.println("RunnableTest线程等待中");
            System.out.println("当前线程为:"+Thread.currentThread().getName());
            System.out.println("当前活跃线程数:"+Thread.activeCount());
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("RunnableTest线程结束");
    }

    public static void main(String[] args) {
        RunnableTest runnableTest = new RunnableTest();
        Thread thread = new Thread(runnableTest,"线程001嘞");
        thread.start();
        System.out.println("主线程结束");
    }
}
